import { IsNotEmpty, Matches, MaxLength } from 'class-validator';

export class FollowStockDto {
  @IsNotEmpty({ message: '股票代码不能为空' })
  @MaxLength(100)
  @Matches(/^[A-Za-z]{2}.*$/, { message: '股票代码格式错误，需以两个英文字母开头' })
  stockCode: string;

  @IsNotEmpty({ message: '股票名称不能为空' })
  @MaxLength(100)
  stockName: string;

  @IsNotEmpty({ message: '股票类型不能为空' })
  @MaxLength(100)
  stockType: string;
}
